]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
layout: Remove _addBarrierEvent
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 15 Feb 2013 02:22:49 +0000 (21:22 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 15 Feb 2013 21:49:46 +0000 (16:49 -0500)
Moving it inline to when we get the event means that we can
remove the duplicate call to _getDistanceAcrossBarrier.

https://bugzilla.gnome.org/show_bug.cgi?id=693854

js/ui/layout.js

index cae7f8187ad38558ed7ab0ff57b2b86f3889f964..f6443edbc7e2225fb845991ed525ab6cf311b35f 100644 (file)
@@ -1190,11 +1190,6 @@ const PressureBarrier = new Lang.Class({
         this._barrierEvents = this._barrierEvents.slice(firstNewEvent);
     },
 
-    _addBarrierEvent: function(event) {
-        this._barrierEvents.push(event);
-        this._currentPressure += this._getDistanceAcrossBarrier(event);
-    },
-
     _onBarrierLeft: function(barrier, event) {
         this._reset();
     },
@@ -1218,7 +1213,8 @@ const PressureBarrier = new Lang.Class({
         this._lastTime = event.time;
 
         this._trimBarrierEvents();
-        this._addBarrierEvent(event);
+        this._barrierEvents.push(event);
+        this._currentPressure += distance;
 
         if (this._currentPressure >= this._threshold) {
             this.emit('trigger');